Merge branch 'betaflight-master'
[betaflight.git] / docs / Board - CC3D.md
blob6b9e568fa47ae5fedfc29f3afcb53c8f7b5b3327
1 # Board - CC3D
3 The OpenPilot Copter Control 3D aka CC3D is a board more tuned to Acrobatic flying or GPS based
4 auto-piloting.  It only has one sensor, the MPU6000 SPI based Accelerometer/Gyro.
5 It also features a 16Mbit SPI based EEPROM chip.  It has 6 ports labeled as inputs (one pin each)
6 and 6 ports labeled as motor/servo outputs (3 pins each).
8 If issues are found with this board please report via the [github issue tracker](https://github.com/cleanflight/cleanflight/issues).
10 The board has a USB port directly connected to the processor.  Other boards like the Naze and Flip32
11 have an on-board USB to uart adapter which connect to the processor's serial port instead.
13 The board cannot currently be used for hexacopters/octocopters.
15 Tricopter & Airplane support is untested, please report success or failure if you try it. 
17 # Pinouts
19 The 8 pin RC_Input connector has the following pinouts when used in RX_PPM/RX_SERIAL mode
21 | Pin | Function  | Notes                            |
22 | --- | --------- | -------------------------------- |
23 | 1   | Ground    |                                  |
24 | 2   | +5V       |                                  |
25 | 3   | Unused |  | 
26 | 4   | SoftSerial1 TX / Sonar trigger | |
27 | 5   | SoftSerial1 RX / Sonar Echo / RSSI_ADC    | Used either for SOFTSERIAL, SONAR or RSSI_ADC*. Only one feature can be enabled at any time. |
28 | 6   | Current   | Enable `feature CURRENT_METER`.  Connect to the output of a current sensor, 0v-3.3v input |
29 | 7   | Battery Voltage sensor | Enable `feature VBAT`. Connect to main battery using a voltage divider, 0v-3.3v input |
30 | 8   | PPM Input | Enable `feature RX_PPM` |
32 *Connect to the output of a PWM-RSSI conditioner, 0v-3.3v input. 
34 The 6 pin RC_Output connector has the following pinouts when used in RX_PPM/RX_SERIAL mode
36 | Pin | Function  | Notes |
37 | --- | ----------| ------|
38 | 1   | MOTOR 1   |       |
39 | 2   | MOTOR 2   |       |
40 | 3   | MOTOR 3   |       |
41 | 4   | MOTOR 4   |       |
42 | 5   | LED Strip |       |
43 | 6   | Unused    |       |
45 The 8 pin RC_Input connector has the following pinouts when used in RX_PARALLEL_PWM mode
47 | Pin | Function | Notes |
48 | --- | ---------| ------|
49 | 1   | Ground   |       |
50 | 2   | +5V      |       |
51 | 3   | Unused   |       | 
52 | 4   | CH1      |       |
53 | 5   | CH2      |       |
54 | 6   | CH3      |       |
55 | 7   | CH4/Battery Voltage sensor      | CH4 if battery voltage sensor is disabled |
56 | 8   | CH5/CH4  | CH4 if battery voltage monitor is enabled|
58 The 6 pin RC_Output connector has the following pinouts when used in RX_PARALLEL_PWM mode
60 | Pin | Function | Notes |
61 | --- | ---------| ------|
62 | 1   | MOTOR 1  |       |
63 | 2   | MOTOR 2  |       |
64 | 3   | MOTOR 3  |       |
65 | 4   | MOTOR 4  |       |
66 | 5   | Unused   |       |
67 | 6   | Unused   |       |
69 # Serial Ports
71 | Value | Identifier   | Board Markings | Notes                                     |
72 | ----- | ------------ | -------------- | ------------------------------------------|
73 | 1     | VCP          | USB PORT       |                                           |
74 | 2     | USART1       | MAIN PORT      | Connected to an MCU controllable inverter |
75 | 3     | USART3       | FLEX PORT      |                                           |
76 | 4     | SoftSerial   | RC connector   | Pins 4 and 5 (Tx and Rx respectively)     |
78 The SoftSerial port is not available when RX_PARALLEL_PWM is used. The transmission data rate is limited to 19200 baud.
80 To connect the GUI to the flight controller you just need a USB cable to use the Virtual Com Port (VCP) or you can use UART1 (Main Port).
82 CLI access is only available via the VCP by default.
84 # Main Port
86 The main port has MSP support enabled on it by default.
88 The main port is connected to an inverter which is automatically enabled as required.  For example, if the main port is used for SBus Serial RX then an external inverter is not required.
90 # Flex Port
92 The flex port will be enabled in I2C mode unless USART3 is used.  You can connect external I2C sensors and displays to this port.
94 You cannot use USART3 and I2C at the same time.
96 ## Flex port pinout
98 | Pin | Signal             | Notes                   |
99 | --- | ------------------ | ----------------------- |
100 | 1   | GND                |                         |
101 | 2   | VCC unregulated    |                         |
102 | 3   | I2C SCL / UART3 TX | 3.3v level              |
103 | 4   | I2C SDA / UART3 RX | 3.3v level (5v tolerant |
106 # Flashing
108 Since CleanFlight version 1.11.0 "single binary image mode" is the only way to get CleanFlight on CC3D. Prior the version 1.11.0 there was a possibility to use "OpenPilot Bootloader compatible image mode", which allows you to easily switch between OpenPilot and CleanFlight, please refer to documentation from releases prior to 1.11.0 for more details.
110 ## Single binary image mode.
112 The entire flash ram on the target processor is flashed with a single image.
114 The image can be flashed by using a USB to UART adapter connected to the main port when the CC3D is put into the STM32 bootloader mode, achieved by powering on the CC3D with the SBL/3.3v pads bridged.  
116 # Restoring OpenPilot bootloader
118 If you have a JLink debugger, you can use JLinkExe to flash the open pilot bootloader.
120 1. Run JLinkExe `/Applications/SEGGER/JLink/JLinkExe`
121 2. `device STM32F103CB`
122 3. `r`
123 4. `h`
124 5. `loadbin opbl.bin, 0x08000000`
125 6. `q`
126 7. Re-plug CC3D.
128 Here's an example session:
131 $ /Applications/SEGGER/JLink/JLinkExe 
132 SEGGER J-Link Commander V4.90c ('?' for help)
133 Compiled Aug 29 2014 09:52:38
134 DLL version V4.90c, compiled Aug 29 2014 09:52:33
135 Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
136 Hardware: V7.00
137 S/N: -1 
138 Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull 
139 VTarget = 3.300V
140 Info: Could not measure total IR len. TDO is constant high.
141 Info: Could not measure total IR len. TDO is constant high.
142 No devices found on JTAG chain. Trying to find device on SWD.
143 Info: Found SWD-DP with ID 0x1BA01477
144 Info: Found Cortex-M3 r1p1, Little endian.
145 Info: FPUnit: 6 code (BP) slots and 2 literal slots
146 Info: TPIU fitted.
147 Cortex-M3 identified.
148 Target interface speed: 100 kHz
149 J-Link>device STM32F103CB
150 Info: Device "STM32F103CB" selected (128 KB flash, 20 KB RAM).
151 Reconnecting to target...
152 Info: Found SWD-DP with ID 0x1BA01477
153 Info: Found SWD-DP with ID 0x1BA01477
154 Info: Found Cortex-M3 r1p1, Little endian.
155 Info: FPUnit: 6 code (BP) slots and 2 literal slots
156 Info: TPIU fitted.
157 J-Link>r
158 Reset delay: 0 ms
159 Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
160 J-Link>h
161 PC = 0800010C, CycleCnt = 00000000
162 R0 = 0000000C, R1 = 0000003F, R2 = 00000000, R3 = 00000008
163 R4 = 00003000, R5 = 023ACEFC, R6 = 200000F0, R7 = 20000304
164 R8 = 023B92BC, R9 = 00000000, R10= ED691105, R11= F626177C
165 R12= 000F0000
166 SP(R13)= 20000934, MSP= 20000934, PSP= 20000934, R14(LR) = FFFFFFFF
167 XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
168 CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
169 J-Link>loadbin opbl.bin, 0x08000000
170 Downloading file [opbl.bin]...
171 WARNING: CPU is running at low speed (8004 kHz).
172 Info: J-Link: Flash download: Flash download into internal flash skipped. Flash contents already match
173 Info: J-Link: Flash download: Total time needed: 0.898s (Prepare: 0.709s, Compare: 0.128s, Erase: 0.000s, Program: 0.000s, Verify: 0.000s, Restore: 0.059s)
174 O.K.
175 J-Link>q